<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script>
  function deepCopy (origin, target = []) {
    if (Array.isArray(origin)) {
      return [...new Set([...origin, ...target])]
    } else if (typeof origin === 'object') {
      const __obj = Object.assign({}, origin, target);

      for (const key in __obj) {
        __obj[key] = deepCopy(origin[key], target[key])
      }

      return __obj;
    } else {
      return target !== undefined ? target : origin
    }
  }

  const obj1 = {
    "id": "builder-editor",
    "name": "builder-editor",
    "type": "draggable",
    "path": "root",
    "renderProps": {},
    "children": [
      {
        "id": "vv-xx-vv",
        "name": "Card",
        "children": [
          {
            "name": "Grid-Item",
            "type": "droppable",
            "renderProps": {
              "style": {
                "width": 200,
                "height": 100,
                "position": "relative"
              }
            }
          }
        ],
        "renderProps": {
          "style": {
            "width": 400,
            "height": 200,
            "position": "relative"
          },
          "name": "Card-自定义"
        },
        "path": [
          "root",
          0
        ]
      }
    ]
  }
  const obj2 = {
    ...obj1,
    "children": [
      {
        "id": "vv-xx-vv",
        "name": "Card",
        "children": [
          {
            "name": "Grid-Item",
            "type": "droppable",
            "renderProps": {
              "style": {
                "width": 200,
                "height": 100,
                "position": "relative"
              }
            }
          }
        ],
        "renderProps": {
          "style": {
            "width": 400,
            "height": 200,
            "position": "relative"
          },
          "name": "Card-自定义",
          "type": "1"
        },
        "path": [
          "root",
          0
        ]
      }
    ]
  }

  console.log(deepCopy(obj1, obj2))
</script>
</body>
</html>